<%@page contentType="text/html; charset=ISO-8859-1" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>

	<style type="text/css">
		@import "http://ajax.googleapis.com/ajax/libs/dojo/1.3.2/dijit/themes/nihilo/nihilo.css";
		@import "http://ajax.googleapis.com/ajax/libs/dojo/1.3.2/dijit/themes/tundra/tundra.css";
	</style>    
	
	<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/dojo/1.3.2/dojo/dojo.xd.js"
		    djConfig="parseOnLoad:true, isDebug:true"></script>
	<script type="text/javascript">
		dojo.require("dojo.parser");
		dojo.require("dijit.layout.ContentPane");
		dojo.require("dijit.layout.TabContainer");
		dojo.require("dijit.form.Button");
	</script>
<!-- OF COURSE YOU NEED TO ADAPT NEXT LINE TO YOUR tiny_mce.js PATH -->
<script type="text/javascript" src="/javascript/tinymce/tiny_mce.js"></script>

<script type="text/javascript">
tinyMCE.init({
	// General options
	mode : "exact",
	elements : "persistedObject.html",
	theme : "advanced",
	plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",

	// Layout options
	width: "600",
	height: "700",
	
	// Theme options
	theme_advanced_buttons1 : "bold,italic,underline,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontsizeselect",
	theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,forecolor,backcolor",
	theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,preview",
	theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",
	theme_advanced_statusbar_location : "bottom",
	theme_advanced_resizing : true,

	// Example content CSS (should be your site CSS)
	content_css : "css/content.css",

	// Drop lists for link/image/media/template dialogs
	template_external_list_url : "lists/template_list.js",
	external_link_list_url : "lists/link_list.js",
	external_image_list_url : "lists/image_list.js",
	media_external_list_url : "lists/media_list.js",

});
</script>

<c:url value="/admin/page/save" var="submitUrl"/>
<c:if test="${!empty sebcms_object.id}">
	<c:url value="/admin/page/update" var="submitUrl"/>
</c:if>

<form action="<c:out value="${submitUrl}" />" method="post">
	<c:if test="${!empty sebcms_object.id}">
		<input type="hidden" name="persistedObject.id" value="<c:out value="${sebcms_object.id}" />" />
	</c:if>

	<div id="mainTabContainer" dojoType="dijit.layout.TabContainer"
        style="float:right;width:624px;height:800px;padding:0;spacing:0" class="tundra">
      <div id="one" dojoType="dijit.layout.ContentPane" title="Content" ;padding:0;spacing:0>
		<table>
		<tr>
			<td colspan="2">
			  	<textarea name="persistedObject.html" ><c:out value="${sebcms_object.html}" escapeXml="false"/></textarea>
			</td>
		</tr>
		</table>
 		</div>
      <div id="two" dojoType="dijit.layout.ContentPane" title="General">
	<table>
		<tr>
			<td>Name</td>
			<td><input type="text" name="persistedObject.name" value="<c:out value="${sebcms_object.name}" />"/></td>
		</tr>
		<tr>
			<td>Custom URL</td>
			<td><input type="text" name="persistedObject.customUrl" value="<c:out value="${sebcms_object.customUrl}" />"/></td>
		</tr>
		<tr>
			<td>Description</td>
			<td><textarea name="persistedObject.description" /><c:out value="${sebcms_object.description}" /></textarea></td>
		</tr>
	</table>
      </div>
      
      <div id="three" dojoType="dijit.layout.ContentPane" title="Security">
        <p>Secuirity is not YET implemented.</p>
      </div>
     </div>
	<table style="clear:both">
		<tr>
			<td>&nbsp;</td>
			<td><input type="submit" value="save" name="submit" /></td>
		</tr>
	</table>
			
</form>